Skip to content

Replace onAttach / onDetach context event pair with onUpdate(before, after)#11859

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
mcculls/context-update-event
Jul 9, 2026
Merged

Replace onAttach / onDetach context event pair with onUpdate(before, after)#11859
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
mcculls/context-update-event

Conversation

@mcculls

@mcculls mcculls commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Motivation

Reduces event cost while allowing listeners to detect the difference between updates to/from root and those updating from one non-root context to another.

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: [PROJ-IDENT]

@mcculls mcculls added the type: feature Enhancements and improvements label Jul 4, 2026
@mcculls mcculls requested a review from a team as a code owner July 4, 2026 19:17
@mcculls mcculls added comp: core Tracer core tag: no release notes Changes to exclude from release notes labels Jul 4, 2026
@mcculls mcculls requested review from PerfectSlayer and bric3 and removed request for a team July 4, 2026 19:17
@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Jul 4, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 56.66% (-0.31%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c0c3c75 | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)

Suite Status
Startup 🟡 warning

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.91 s 14.66 s [+0.9%; +2.6%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.65 s 13.75 s [-1.5%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 17.37 s 17.33 s [-0.6%; +1.0%] (no difference)
startup:petclinic:iast:Agent 17.37 s 17.50 s [-1.6%; +0.2%] (no difference)
startup:petclinic:profiling:Agent 17.28 s 17.41 s [-1.9%; +0.5%] (no difference)
startup:petclinic:sca:Agent 17.48 s 16.65 s [+0.6%; +9.3%] (maybe worse)
startup:petclinic:tracing:Agent 16.06 s 16.62 s [-7.6%; +0.9%] (no difference)

Commit: c0c3c753 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@mcculls mcculls force-pushed the mcculls/context-update-event branch from 4d37ba4 to 1c76b54 Compare July 4, 2026 23:04
@mcculls mcculls force-pushed the mcculls/context-update-event branch from 1c76b54 to c0c3c75 Compare July 5, 2026 09:11

@PerfectSlayer PerfectSlayer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I like the fact there is no longer a "before" event (onDettach) so all notifications happen after the related context event is resolved.

try (ContextScope scope = context.attach()) {
continuation = context.capture(); // capture while active
continuation.hold();
listener.assertNewEvents("update:{root}->value", "capture:value");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 praise: ‏Like the fact the events moved near where they happen. The tests are stricter and easier to read 👍

@mcculls mcculls added this pull request to the merge queue Jul 8, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 8, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-08 21:45:27 UTC ℹ️ Start processing command /merge


2026-07-08 21:45:33 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 2h (p90).


2026-07-08 23:46:07 UTCMergeQueue: The build pipeline has timeout

The merge request has been interrupted because the build 5670458454924532941 took longer than expected. The current limit for the base branch 'master' is 120 minutes.

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 8, 2026
@mcculls

mcculls commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 8, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-08 23:47:05 UTC ℹ️ Start processing command /merge


2026-07-08 23:47:10 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 2h (p90).


2026-07-09 00:51:32 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit bd65ef4 into master Jul 9, 2026
588 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the mcculls/context-update-event branch July 9, 2026 00:51
@github-actions github-actions Bot added this to the 1.65.0 milestone Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: no release notes Changes to exclude from release notes type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants